﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="manageGame.aspx.cs" Inherits="WebRole1.manageGame" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            height: 55px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table>
<tr>
<td>
    Current Tag</td>
<td>
    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
        AutoGenerateColumns="False" DataKeyNames="joint" 
        DataSourceID="SqlDataSource1">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="joint" HeaderText="joint" 
                 SortExpression="joint"/>
            <asp:BoundField DataField="jointName" HeaderText="jointName" 
                SortExpression="jointName" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:dbConnection %>" 
        DeleteCommand="DELETE FROM [tag] WHERE [uid] = @uid" 
        InsertCommand="INSERT INTO [tag] ([joint]) VALUES (@joint)" 
        SelectCommand="SELECT * FROM [tag]" 
        UpdateCommand="UPDATE [tag] SET [jointName] = @jointName WHERE [joint] = @joint">
        <DeleteParameters>
            <asp:Parameter Name="uid" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="joint" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="jointName" Type="String" />
            <asp:Parameter Name="joint" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
</td>
</tr>
<td>
    Create Tag</td>
<td>
    <asp:FormView ID="FormView1" runat="server" DataKeyNames="joint" 
        DataSourceID="SqlDataSource1" DefaultMode="Insert">
        <EditItemTemplate>
            joint:
            <asp:Label ID="jointLabel1" runat="server" Text='<%# Eval("joint") %>' />
            <br />
            jointName:
            <asp:TextBox ID="jointNameTextBox" runat="server" 
                Text='<%# Bind("jointName") %>' />
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Update" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </EditItemTemplate>
        <InsertItemTemplate>
            joint:
            <asp:TextBox ID="jointTextBox" runat="server" Text='<%# Bind("joint") %>' />
            <br />
            jointName:
            <asp:TextBox ID="jointNameTextBox" runat="server" 
                Text='<%# Bind("jointName") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="Insert" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </InsertItemTemplate>
        <ItemTemplate>
            joint:
            <asp:Label ID="jointLabel" runat="server" Text='<%# Eval("joint") %>' />
            <br />
            jointName:
            <asp:Label ID="jointNameLabel" runat="server" Text='<%# Bind("jointName") %>' />
            <br />
            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                CommandName="Edit" Text="Edit" />
            &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                CommandName="Delete" Text="Delete" />
            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                CommandName="New" Text="New" />
        </ItemTemplate>
    </asp:FormView>
</td>

    <tr>
<td>
    &nbsp;</td>
<td>
    &nbsp;</td>
</tr>

    <tr>
<td>
    Current ExeType</td>
<td>
    <asp:GridView ID="GridView4" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="uid" DataSourceID="SqlDataSource4">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="uid" HeaderText="uid" InsertVisible="False" 
                ReadOnly="True" SortExpression="uid" />
            <asp:BoundField DataField="description" HeaderText="description" 
                SortExpression="description" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
        ConnectionString="<%$ ConnectionStrings:dbConnection %>" 
        DeleteCommand="DELETE FROM [exeType] WHERE [uid] = @uid" 
        InsertCommand="INSERT INTO [exeType] ([description]) VALUES (@description)" 
        SelectCommand="SELECT * FROM [exeType]" 
        UpdateCommand="UPDATE [exeType] SET [description] = @description WHERE [uid] = @uid">
        <DeleteParameters>
            <asp:Parameter Name="uid" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="description" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="description" Type="String" />
            <asp:Parameter Name="uid" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
        </td>
</tr>

    <tr>
<td>
    Create ExeType</td>
<td>
    <asp:FormView ID="FormView3" runat="server" DataKeyNames="uid" 
        DataSourceID="SqlDataSource4" DefaultMode="Insert">
        <EditItemTemplate>
            uid:
            <asp:Label ID="uidLabel1" runat="server" Text='<%# Eval("uid") %>' />
            <br />
            description:
            <asp:TextBox ID="descriptionTextBox" runat="server" 
                Text='<%# Bind("description") %>' />
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Update" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </EditItemTemplate>
        <InsertItemTemplate>
            description:
            <asp:TextBox ID="descriptionTextBox" runat="server" 
                Text='<%# Bind("description") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="Insert" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </InsertItemTemplate>
        <ItemTemplate>
            uid:
            <asp:Label ID="uidLabel" runat="server" Text='<%# Eval("uid") %>' />
            <br />
            description:
            <asp:Label ID="descriptionLabel" runat="server" 
                Text='<%# Bind("description") %>' />
            <br />
            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                CommandName="Edit" Text="Edit" />
            &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                CommandName="Delete" Text="Delete" />
            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                CommandName="New" Text="New" />
        </ItemTemplate>
    </asp:FormView>
        </td>
</tr>

    <tr>
<td>
    &nbsp;</td>
<td>
    &nbsp;</td>
</tr>
    <tr>
<td>
    Current Exe</td>
<td>
    <asp:GridView ID="GridView2" runat="server" AllowSorting="True" 
        AutoGenerateColumns="False" DataKeyNames="uid" DataSourceID="SqlDataSource2">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="uid" HeaderText="uid" InsertVisible="False" 
                 SortExpression="uid" />
            <asp:BoundField DataField="name" HeaderText="name" SortExpression="name" />
            <asp:BoundField DataField="path" HeaderText="path" SortExpression="path" />
            <asp:BoundField DataField="description" HeaderText="description" 
                SortExpression="description" />
            <asp:BoundField DataField="exeType" HeaderText="exeType" 
                SortExpression="exeType" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:dbConnection %>" 
        DeleteCommand="DELETE FROM [exe] WHERE [uid] = @uid" 
        InsertCommand="INSERT INTO [exe] ([name], [path], [description]) VALUES (@name, @path, @description)" 
        SelectCommand="SELECT * FROM [exe]" 
        UpdateCommand="UPDATE [exe] SET [name] = @name, [path] = @path, [description] = @description WHERE [uid] = @uid">
        <DeleteParameters>
            <asp:Parameter Name="uid" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="name" Type="String" />
            <asp:Parameter Name="path" Type="String" />
            <asp:Parameter Name="description" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="name" Type="String" />
            <asp:Parameter Name="path" Type="String" />
            <asp:Parameter Name="description" Type="String" />
            <asp:Parameter Name="uid" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
</td>
</tr>
    <tr>
<td colspan="2">
    Create Exe</td>
</tr>
    <tr>
<td style="text-align: right">
    Select Exe</td>
<td>
    <asp:FileUpload ID="FileUpload1" runat="server" />
</td>
</tr>
    <tr>
<td class="style1" style="text-align: right">
    Name<br />
    Description<br />
    ExeType<br />
</td>
<td class="style1">
    <asp:TextBox ID="tbx_name" runat="server"></asp:TextBox>
    <br />
    <asp:TextBox ID="tbx_desc" runat="server"></asp:TextBox>
    <br />
    <asp:TextBox ID="tbx_exeType" runat="server"></asp:TextBox>
</td>
</tr>
    <tr>
<td style="text-align: right">
    &nbsp;</td>
<td>
    <asp:Button ID="btn_submit" runat="server" onclick="btn_submit_Click" 
        Text="Submit" UseSubmitBehavior="False" />
    <br />
    <asp:Label ID="lbl_path" runat="server" Text="Label"></asp:Label>
</td>
</tr>
    <tr>
<td style="text-align: right">
    &nbsp;</td>
<td>
    &nbsp;</td>
</tr>
    <tr>
<td style="text-align: right">
    Current Exe_tag</td>
<td>
    <asp:GridView ID="GridView3" runat="server" AllowSorting="True" 
        AutoGenerateColumns="False" DataKeyNames="exeID,joint" 
        DataSourceID="SqlDataSource3">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="exeID" HeaderText="exeID" ReadOnly="True" 
                SortExpression="exeID" />
            <asp:BoundField DataField="joint" HeaderText="joint" ReadOnly="True" 
                SortExpression="joint" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:dbConnection %>" 
        DeleteCommand="DELETE FROM [exe_tag] WHERE [exeID] = @exeID" 
        InsertCommand="INSERT INTO [exe_tag] ([exeID], [joint]) VALUES (@exeID, @joint)" 
        SelectCommand="SELECT * FROM [exe_tag]" 
        UpdateCommand="UPDATE [exe_tag] SET [joint] = @joint WHERE [exeID] = @exeID">
        <DeleteParameters>
            <asp:Parameter Name="exeID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="exeID" Type="Int32" />
            <asp:Parameter Name="joint" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="joint" Type="String" />
            <asp:Parameter Name="exeID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
</td>
</tr>
    <tr>
<td style="text-align: right">
    Assign</td>
<td>
    <asp:FormView ID="FormView2" runat="server" DataKeyNames="exeID,joint" 
        DataSourceID="SqlDataSource3" DefaultMode="Insert">
        <EditItemTemplate>
            exeID:
            <asp:Label ID="exeIDLabel1" runat="server" Text='<%# Eval("exeID") %>' />
            <br />
            joint:
            <asp:Label ID="jointLabel1" runat="server" Text='<%# Eval("joint") %>' />
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Update" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </EditItemTemplate>
        <InsertItemTemplate>
            exeID:
            <asp:TextBox ID="exeIDTextBox" runat="server" Text='<%# Bind("exeID") %>' />
            <br />
            joint:
            <asp:TextBox ID="jointTextBox" runat="server" Text='<%# Bind("joint") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="Insert" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </InsertItemTemplate>
        <ItemTemplate>
            exeID:
            <asp:Label ID="exeIDLabel" runat="server" Text='<%# Eval("exeID") %>' />
            <br />
            joint:
            <asp:Label ID="jointLabel" runat="server" Text='<%# Eval("joint") %>' />
            <br />
            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                CommandName="Edit" Text="Edit" />
            &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                CommandName="Delete" Text="Delete" />
            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                CommandName="New" Text="New" />
        </ItemTemplate>
    </asp:FormView>
</td>
</tr>
    <tr>
<td style="text-align: right">
    &nbsp;</td>
<td>
    &nbsp;</td>
</tr>
    <tr>
<td style="text-align: right">
    Current Stage</td>
<td>
    <asp:GridView ID="GridView5" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="uid" DataSourceID="SqlDataSource5">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="uid" HeaderText="uid" InsertVisible="False" 
                ReadOnly="True" SortExpression="uid" />
            <asp:BoundField DataField="name" HeaderText="name" SortExpression="name" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
        ConnectionString="<%$ ConnectionStrings:dbConnection %>" 
        DeleteCommand="DELETE FROM [stage] WHERE [uid] = @uid" 
        InsertCommand="INSERT INTO [stage] ([name]) VALUES (@name)" 
        SelectCommand="SELECT * FROM [stage]" 
        UpdateCommand="UPDATE [stage] SET [name] = @name WHERE [uid] = @uid">
        <DeleteParameters>
            <asp:Parameter Name="uid" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="name" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="name" Type="String" />
            <asp:Parameter Name="uid" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
</td>
</tr>
    <tr>
<td style="text-align: right">
    Create Stage</td>
<td>
    <asp:FormView ID="FormView4" runat="server" DataKeyNames="uid" 
        DataSourceID="SqlDataSource5" DefaultMode="Insert">
        <EditItemTemplate>
            uid:
            <asp:Label ID="uidLabel1" runat="server" Text='<%# Eval("uid") %>' />
            <br />
            name:
            <asp:TextBox ID="nameTextBox" runat="server" Text='<%# Bind("name") %>' />
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Update" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </EditItemTemplate>
        <InsertItemTemplate>
            name:
            <asp:TextBox ID="nameTextBox" runat="server" Text='<%# Bind("name") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="Insert" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </InsertItemTemplate>
        <ItemTemplate>
            uid:
            <asp:Label ID="uidLabel" runat="server" Text='<%# Eval("uid") %>' />
            <br />
            name:
            <asp:Label ID="nameLabel" runat="server" Text='<%# Bind("name") %>' />
            <br />
            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                CommandName="Edit" Text="Edit" />
            &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                CommandName="Delete" Text="Delete" />
            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                CommandName="New" Text="New" />
        </ItemTemplate>
    </asp:FormView>
</td>
</tr>
    <tr>
<td style="text-align: right">
    &nbsp;</td>
<td>
    &nbsp;</td>
</tr>
    <tr>
<td style="text-align: right">
    Current Exe_Stage</td>
<td>
    <asp:GridView ID="GridView6" runat="server" AllowSorting="True" 
        AutoGenerateColumns="False" DataKeyNames="exe,stage" 
        DataSourceID="SqlDataSource6">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" />
            <asp:BoundField DataField="exe" HeaderText="exe" ReadOnly="True" 
                SortExpression="exe" />
            <asp:BoundField DataField="stage" HeaderText="stage" ReadOnly="True" 
                SortExpression="stage" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource6" runat="server" 
        ConnectionString="<%$ ConnectionStrings:dbConnection %>" 
        DeleteCommand="DELETE FROM [exe_stage] WHERE [exe] = @exe AND [stage] = @stage" 
        InsertCommand="INSERT INTO [exe_stage] ([exe], [stage]) VALUES (@exe, @stage)" 
        SelectCommand="SELECT * FROM [exe_stage]">
        <DeleteParameters>
            <asp:Parameter Name="exe" Type="Int32" />
            <asp:Parameter Name="stage" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="exe" Type="Int32" />
            <asp:Parameter Name="stage" Type="Int32" />
        </InsertParameters>
    </asp:SqlDataSource>
</td>
</tr>
    <tr>
<td style="text-align: right">
    Create Exe_stage</td>
<td>
    <asp:FormView ID="FormView5" runat="server" DataKeyNames="exe,stage" 
        DataSourceID="SqlDataSource6" DefaultMode="Insert">
        <EditItemTemplate>
            exe:
            <asp:Label ID="exeLabel1" runat="server" Text='<%# Eval("exe") %>' />
            <br />
            stage:
            <asp:Label ID="stageLabel1" runat="server" Text='<%# Eval("stage") %>' />
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Update" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </EditItemTemplate>
        <InsertItemTemplate>
            exe:
            <asp:TextBox ID="exeTextBox" runat="server" Text='<%# Bind("exe") %>' />
            <br />
            stage:
            <asp:TextBox ID="stageTextBox" runat="server" Text='<%# Bind("stage") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="Insert" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </InsertItemTemplate>
        <ItemTemplate>
            exe:
            <asp:Label ID="exeLabel" runat="server" Text='<%# Eval("exe") %>' />
            <br />
            stage:
            <asp:Label ID="stageLabel" runat="server" Text='<%# Eval("stage") %>' />
            <br />
            <asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                CommandName="Delete" Text="Delete" />
            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                CommandName="New" Text="New" />
        </ItemTemplate>
    </asp:FormView>
</td>
</tr>
</table>
</asp:Content>
